package com.zhao.retry.demo.config;

import com.zhao.retry.demo.RetryClientHttpRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Created on 2020/5/20.
 *
 * @author zhao
 * @email 136689260@qq.com
 */

@Configuration
public class RestConfig {


    @Bean
    public RestTemplate restTemplate(RetryClientHttpRequestInterceptor retryClientHttpRequestInterceptor) {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.getInterceptors().add(retryClientHttpRequestInterceptor);
        return restTemplate;
    }
}
